from django.db import models

# Create your models here.


class Activity(models.Model):
    """
    活动模型类
    """
    name = models.CharField(max_length=32, verbose_name='活动名')
    city = models.CharField(max_length=32, verbose_name='举办城市')
    cover = models.CharField(max_length=128, verbose_name='活动缩略图')
    start_time = models.DateTimeField(verbose_name='活动开始时间')
    end_time = models.DateTimeField(verbose_name='活动结束时间')
    end_line = models.DateTimeField(verbose_name='报名截止时间')
    address = models.CharField(max_length=64, verbose_name='举办地点')
    sponsor= models.CharField(max_length=16, verbose_name='主办方')
    abstract= models.TextField(verbose_name='活动简介')
    detail = models.TextField(verbose_name='活动详情')
    website = models.CharField(max_length=128, verbose_name='活动官网')
    status = models.SmallIntegerField(verbose_name='报名状态', default=1)
    click_count = models.IntegerField(verbose_name='点击量', default=0)

    class Meta():
        db_table = 'tb_activity'
        verbose_name = '活动'
        verbose_name_plural = verbose_name

    def __str__(self):
        return str(self.id) + self.name